﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/Shared.cshtml";
    var productPic = ViewBag.ProductPic as List<ProductPic>;
}
@model IEnumerable<Comment>;

<section>
    <div class="view-product">
        <div class="info-center">
            <div class="manage-head">
                <h6 class=" padding-left manage-head-con ">您的评价</h6>
            </div>
            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                        <tr>
                            <th width="10%">姓名</th>
                            <th width="20%">留言时间</th>
                            <th width="30%">留言内容</th>
                            <th width="20%">商品</th>
                            <th width="20%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>@item.Name</td>
                                <td>@item.CreateTime</td>
                                <td>@item.Content</td>
                                <td>
                                    @foreach (var pro in productPic.Where(x=>x.ProductId==@item.ProductId))
                                    {
                                        <a href="/products/prodetails/@item.ProductId">
                                                <img src="@pro.PicAddress" alt="" width="100px" height="50px">
                                                </a>
                                    }
                                </td>
                                <td>
                                    <el-button style="padding:3px 5px;width:65px" typeof="text"><i class="el-icon-delete"></i><el-link type="danger" plain href="/YongHuZhongXin/del/@item.Id">删除</el-link></el-button>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>